package name.huzhenbo.java.algorithm.talent;

class ArrayRotate {
    public int[] go(int[] array, int count) {
        int[] temp = new int[count];
        for(int i = 0; i < array.length; i++){
            if(i < count){
                temp[i] = array[i];
            }else{
                array[i - count] = array[i];
            }
        }
        for(int i = 0; i < temp.length; i++){
            array[i + array.length - count] = temp[i];
        }
        return array;
    }
}
